//
//  NSString+FilePath.m
//  NRWMall
//
//  Created by 邢毅 on 2018/5/9.
//  Copyright © 2018年 com.anpxd. All rights reserved.
//

#import "NSString+FilePath.h"

@implementation NSString (FilePath)

+ (NSString *)getHomeDir {
    
    return NSHomeDirectory();
}

+ (NSString *)getLibraryDir {
    
    return [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject];
}

+ (NSString *)getDocumentsDir {
    
    return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
}

+ (NSString *)getCachesDir {
    
    return [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
}

+ (NSString *)getTmpDir {
    
    return NSTemporaryDirectory();
}

+ (NSString *)getVersionFilePath {
    
    return [[NSString getDocumentsDir] stringByAppendingPathComponent:@"version.txt"];
}

@end
